import slick.driver.JdbcProfile

/**
 * Created by corbin on 15/9/6.
 *
 */
trait UserComponent {
  val username: String
  val password: String
}

trait DataBaseConfigComponent {
  val url: String
  val database: String
  val jdbcDriver: String
  val slickDriver: String
  val driver: JdbcProfile
}

trait MysqlConfig extends DataBaseConfigComponent with UserComponent {
  val url = s"jdbc:mysql://localhost:3306/$database"
  val jdbcDriver = "com.mysql.jdbc.Driver"
  val slickDriver = "slick.driver.MySQLDriver"
  val driver: JdbcProfile = slick.driver.MySQLDriver
}

trait H2Config extends DataBaseConfigComponent with UserComponent {
  val init: String
  val username: String = ""
  val password: String = ""
  val url = s"jdbc:h2:mem:$database;INIT=$init"
  val jdbcDriver = "org.h2.Driver"
  val slickDriver = "slick.driver.H2Driver"
  val driver: JdbcProfile = slick.driver.H2Driver
}



